﻿
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using LogSystem;
namespace LogSystem2
{
    class Program
    {
        public static long GetTimestamp()
        {
            //获取从1970年一月一日0点0分0秒0微妙开始
            return (DateTime.UtcNow.Ticks - new DateTime(1970, 1, 1, 0, 0, 0, 0).Ticks) / 10000;
        }
        static void Main(string[] args)
        {
            LogSys.Initilize("./log");
            LogSys.SetAllLogCallback((obj) => { Console.WriteLine(obj); });
           
            long t0 = GetTimestamp();
            for (int i = 0; i < 100; i++)
            {
                LogSys.LogInfo("info");
                LogSys.LogWarning(i);
                LogSys.LogError("error");
                Thread.Sleep(10);
            }
            Console.WriteLine("ms:" + (GetTimestamp() - t0));

           
            Console.Read();
            LogSys.Terminate();
        }

    }
}
